package service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.UserDao;
import po.User;

@Service
public class LoginService {
	@Autowired
	private UserDao userDao;

	// 判断用户是否登陆成功
	public boolean execute(String username, String password) {
		User user = new User();
		user.setUsername(username);
		user.setPassword(password);
		User u = userDao.getUser(user);
		if (u != null) {
			return true;
		} else {
			return false;
		}
	}
}
